[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
  TIMER_START

  .  Summary

  timer_start(int <time>);

  .  Description

  The timer functions are used to set and keep track of a timer vari-
  able.

  The timer_start function is used to start a timer. This timer can
  later be used to check if a certain period of time has elapsed from
  when the timer was started. This function returns an integer value
  called a timer handle, that is used to refer to this timer in the
  future. The <time> parameter is the time from the present (in tenths
  of a second) after which the timer should be considered elapsed (for
  use with the time_up function). If the time_up function will not be
  used, then this parameter can be anything.

  .  Return Value

  timer_start returns an integer number representing a 'handle' by
  which a timer will be referred to.

  .  Example

  int t;

  t = timer_start(100);    // delay for 10 seconds
  while (!time_up(t))
   ;
  timer_free(t);

  // start a timer and loop forever, printing the elapsed time
  // in tenths of seconds
  t = timer_start(0);
  while (1)
   {
    printn(timer_total(t));
    prints("");
   }

See Also: delay timer_free timer_restart timer_start timer_total time_up
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson